openssl移植 发送ssl邮件 SSL | 您所在的位置:网站首页 › connect返回-1 error › openssl移植 发送ssl邮件 SSL |
交叉编译
CC=arm-mol-linux-uclibcgnueabihf-gcc ./config no-asm shared --prefix=$PWD/_install vi Makefile 删除-m64 make; make install 如果出现一下错误 ./libcrypto.so: undefined reference to `getcontext' ./libcrypto.so: undefined reference to `setcontext' ./libcrypto.so: undefined reference to `makecontext' 加上 no-async CC=arm-mol-linux-uclibcgnueabihf-gcc /config no-asm no-async hared --prefix=$PWD/_install no-async: 交叉编译工具链没有提供GNU C的ucontext库遇到VFP 加上 -mfloat-abi=hard CC=arm-mol-linux-uclibcgnueabihf-gcc ./config no-asm no-async shared -mfloat-abi=hard --prefix=$PWD/_install 每次config执行后vi Makefile 删除-m64 make; make install SSL发送邮件SSL_connect() 返回-1 ,调用SSL_get_error(ssl, err);发现返回值为 1 #define SSL_ERROR_NONE 0 #define SSL_ERROR_SSL 1 #define SSL_ERROR_WANT_READ 2 #define SSL_ERROR_WANT_WRITE 3 #define SSL_ERROR_WANT_X509_LOOKUP 4 #define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ #define SSL_ERROR_ZERO_RETURN 6 #define SSL_ERROR_WANT_CONNECT 7 #define SSL_ERROR_WANT_ACCEPT 8 SSL_ERROR_SSL 错误的SSL 调用 ERR_print_errors_fp(stderr);查看错误信息 ]258:error:0306E06C:bignum routines:BN_mod_inverse:no inverse:bn_gcd.c:491: [2022:05:18-:14:20:42]258:error:14098077:SSL routines:SSL3_SEND_CLIENT_KEY_EXCHANGE:bad rsa encrypt:s3_clnt.c:1937: 类似错误是编译错误是未选择芯片构架 修改config 文件 重新编译openssl 参考config 只需注意armv7架构和linux2 修改如下 read GUESSOS GUESSOS="armv7-mol-linux2" echo Operating system: $GUESSOS 重新编译openssl SSL_connect() 不在返回-1;发送邮件成功 |
CopyRight 2018-2019 实验室设备网 版权所有 |